﻿CREATE TABLE [dbo].[t_ContractCondition] (
    [Code]                  CHAR (2)       NOT NULL,
    [Advance]               TINYINT        NULL,
    [PaymentTypeID]         TINYINT        NOT NULL,
    [Term_Max]              TINYINT        NOT NULL,
    [APR_Min]               NUMERIC (4, 2) NULL,
    [AF_Max]                SMALLINT       NOT NULL,
    [AFRatio_Max]           TINYINT        NULL,
    [SellPriceRatio_Max]    TINYINT        NULL,
    [OverageAllowed]        SMALLINT       NULL,
    [OverageFeeRatio]       TINYINT        NULL,
    [InterestBasisID]       TINYINT        NOT NULL,
    [CarBookTypeID]         TINYINT        NOT NULL,
    [DownPayment_Min]       TINYINT        NOT NULL,
    [DTI_Max]               TINYINT        NOT NULL,
    [PTI_Max]               TINYINT        NOT NULL,
    [JobTime_Min]           TINYINT        NOT NULL,
    [JobsCountIn2Years_Max] TINYINT        NOT NULL,
    [ResidenceTime_Min]     TINYINT        NOT NULL,
    [AreaTime_Min]          TINYINT        NOT NULL,
    [ModelAge_Max]          TINYINT        NOT NULL,
    [MileagePerYear_Max]    SMALLINT       NOT NULL,
    [Miles_Max]             INT            NOT NULL,
    [ServiceContract_Max]   SMALLINT       NOT NULL,
    [FeeRate]               TINYINT        NULL,
    [Fee_Max]               SMALLINT       NOT NULL,
    [RecourseMonths]        TINYINT        NOT NULL,
    [DeductFeeFromReserve]  BIT            NOT NULL,
    [TrackerReward]         TINYINT        NOT NULL
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N't_ContractCondition', @level2type = N'COLUMN', @level2name = N'OverageFeeRatio';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'50%', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N't_ContractCondition', @level2type = N'COLUMN', @level2name = N'DTI_Max';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'in months', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N't_ContractCondition', @level2type = N'COLUMN', @level2name = N'JobTime_Min';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'in months', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N't_ContractCondition', @level2type = N'COLUMN', @level2name = N'ResidenceTime_Min';

